package com.周阳.中介者模式.机长塔台案例;

public class Client {
    public static void main(String[] args) {

        /**
         * 创建中介者对象
         */
        TowerInterface captain = new ControllerTower();
        /**
         * 2个同事类机长同时请求起飞，因为只有一个跑到，所以HNHK8778先请求的能起飞
         */
        HNHK8778 hnhk8778 = new HNHK8778(captain);
        SC8633 sc8633 = new SC8633(captain);
        hnhk8778.fly();
        sc8633.fly();
        /**
         * HNHK8778起飞成功
         */
        hnhk8778.success();
        /**
         * SC8633再次请求起飞，这时候因为NHK8778起飞成功，跑到是空的，所以SC8633再次就能起飞成功
         */
        sc8633.fly();
    }
}
